package exam.meituan.T2;


import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int opt = sc.nextInt();
        String s = sc.next();
        if (s.length() != n)
            return;
        if (opt == 1) {
            String res = encode(s);
            System.out.println(res);
        } else if (opt == 2) {
            String res = decode(s);
            System.out.println(res);
        }
    }

    public static String encode(String s) {
        char[] chs = s.toCharArray();
        List<Character> sb = new LinkedList<>();
        for (char ch : chs) {
            sb.add(ch);
        }
        StringBuilder res = new StringBuilder();
        while (sb.size() > 0) {
            int idx = (sb.size() + 1) / 2;
            Character ch = sb.remove(idx - 1);
            res.append(ch);
        }
        return res.toString();
    }

    public static String decode(String s) {
        int n = s.length();
        List<Character> list = new LinkedList<>();
        for (int i = s.length()-1; i>=0; --i) {
            char ch = s.charAt(i);
            int idx = list.size() / 2;
            list.add(idx, ch);
        }
        StringBuilder sb = new StringBuilder();
        for (Character ch : list) {
            sb.append(ch);
        }
        return sb.toString();
    }
}
